﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace comdiinfo
{
    public class G64ImageData
    {
        private byte[] imageData { get; set; }
        public int Length { get { return imageData.Length; } }
        public List<G64AreaInfo> areaInfos { get; set; }
        public G64ImageData(byte[] dataBuffer)
        {
            this.imageData = dataBuffer;
            this.areaInfos = new List<G64AreaInfo>();
        }
        public byte[] readBytes(int srcOffset, int count, String areaInfoText)
        {
            byte[] retArray = new byte[count];
            Buffer.BlockCopy(this.imageData, srcOffset, retArray, 0, count);
            G64AreaInfo g64AreaInfo = new G64AreaInfo();
            g64AreaInfo.StartOffset = srcOffset;
            g64AreaInfo.AreaLength = count;
            g64AreaInfo.InfoText = areaInfoText;
            this.areaInfos.Add(g64AreaInfo);
            return (retArray);
        }
        public List<G64AreaInfo> GetAreaInfos()
        {
            return areaInfos;
        }
    }
}
